﻿@model WaiGaoQiaoWeb.Models.TempCardInfoVM
@{
    ViewBag.Title = "EditTempCardInfo";
    Layout = "~/Views/Shared/_Layout.cshtml";
}
@section Head
{
    @Html.Css("EditForm")
    <script type="text/javascript" language="javascript">
        $(document).ready(function () {
            $("form").makeValidationInline();
            //保存
            $("#btnSave").click(function (event) {
                if (!$("#fmEdit").valid()) {
                    return false;
                }
                $('#fmEdit').ajaxSubmit(function (callback) {
                    if (callback) {
                        CloseModelWindow(null, true);
                    }
                });
            });
            //关闭
            $("#btnCancel").click(function (e) {
                CloseModelWindow(null, false);
            });
            $("#DEP_ID").change(function (e) {
                var vdepid = $("#DEP_ID :selected").val();
                $.ajax({
                    type: "POST",
                    url: '@Url.Action("GetGroupDeptChange")',
                    data: { depid: vdepid },
                    dataType: "json",
                    async: true,
                    success: function (data) {
                        $("#GroupIdDept").empty();
                        var t = $("#GroupIdDept")
                        for (var i in data) {
                            var x = data[i];
                            t.append("<option value='" + x.Value + "'>" + x.Text + "</option>");
                        }
                    },
                    error: function () { }
                });
            });
        });    
    </script>
}
@using (Html.BeginForm("SaveTempCardInfoEdit", "TempCardInfo", FormMethod.Post, new { id = "fmEdit" }))
{
    @Html.ValidationSummary(true)
    <div id="editFormWrapper">
        <br />
        @Html.HiddenFor(model => model.PID)
        <div class="editFormItems">
            <div class="editFormLabel">
                姓名：
            </div>
            <div class="editForm">
                @Html.TextBoxFor(model => model.PName)<span style="color: Red;">*</span>
                @Html.ValidationMessageFor(model => model.PName)
            </div>
        </div>
        <div class="editFormItems">
            <div class="editFormLabel">
                部门：
            </div>
            <div class="editForm">
                @Html.DropDownListFor(model => model.DEP_ID,
                                   ViewData["Deptment"] as IEnumerable<SelectListItem>,
                                   new { @style = "width:130px; height:22px; font-size:13px;" })<span style="color: Red;">*</span>
                @Html.ValidationMessageFor(model => model.DEP_ID)
            </div>
        </div>
        <div class="editFormItems">
            <div class="editFormLabel">
                班组：
            </div>
            <div class="editForm">
                @Html.DropDownListFor(model => model.GroupIdDept,
                                   ViewData["GroupDept"] as IEnumerable<SelectListItem>,
                                   new { @style = "width:100px; height:22px; font-size:13px;" })
            </div>
        </div>
        <div class="editFormItems">
            <div class="editFormLabel">
                岗位：
            </div>
            <div class="editForm">
                @Html.DropDownListFor(model => model.structrueId,
                                            ViewData["StructrueName"] as IEnumerable<SelectListItem>,
                                   new { @style = "width:100px; height:22px; font-size:13px;" })
            </div>
        </div>
        <div class="editFormItems">
            <div class="editFormLabel">
                人员编号：
            </div>
            <div class="editForm">
                @Html.TextBoxFor(model => model.EMPNO)<span style="color: Red;">*</span>
                @Html.ValidationMessageFor(model => model.EMPNO)
            </div>
        </div>
        <div class="editFormItems">
            <div class="editFormLabel">
                卡状态：
            </div>
            <div class="editForm">
                @Html.TextBoxFor(model => model.CARDSTATUS, new { @readonly = true, disabled = "disabled" })
                @Html.ValidationMessageFor(model => model.CARDSTATUS)
            </div>
        </div>
        <div class="editFormItems">
            <div class="editFormLabel">
                卡序列号：
            </div>
            <div class="editForm">
                @Html.TextBoxFor(model => model.CARDSERIAL, new { @readonly = true, disabled = "disabled" })
                @Html.ValidationMessageFor(model => model.CARDSERIAL)
            </div>
        </div>
        <div class="editFormItems">
            <div class="editFormLabel">
                卡内余额：
            </div>
            <div class="editForm">
                @Html.TextBoxFor(model => model.Balance, new { @readonly = true, disabled = "disabled" })
                @Html.ValidationMessageFor(model => model.Balance)
            </div>
        </div>
        <div class="editFormItems">
            <div class="editFormLabel">
                入职日期：
            </div>
            <div class="editForm">
                @Html.TextBoxFor(model => model.EnrollDate, new { @readonly = true, disabled = "disabled" })
                @Html.ValidationMessageFor(model => model.EnrollDate)
            </div>
        </div>
    </div>
    <div class="buttonpanel">
        <div style="float: right; margin-right: 10px;">
            <a id="btnSave" href="javascript:void(0);" class="button"><span>保存</span></a> <a
                id="btnCancel" href="javascript:void(0);" class="button"><span>关闭</span></a>
        </div>
    </div>   
}
